package com.su.service;

import com.su.dao.BookMapper;
import com.su.pojo.Book;
import com.su.pojo.BookVo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Book book) {
        return bookMapper.addBook(book);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Book book) {
        return bookMapper.updateBook(book);
    }

    @Override
    public Book getBookById(int id) {
        return bookMapper.getBookById(id);
    }

    @Override
    public List<Book> getBooks(BookVo bookVo) {
        return bookMapper.getBooks(bookVo);
    }

    @Override
    public List<Integer> getBookType() {
        return bookMapper.getBookType();
    }

    @Override
    public int batchImportBook(List<Book> bookList) {
       return bookMapper.batchImportBook(bookList);
    }
}
